﻿@model IEnumerable<Unijovem.UI.Models.DevocionalModel>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Manter")
</p>
<table>
    <tr>
        <th></th>
        <th>
            Titulo
        </th>
        <th>
            Autor
        </th>
        <th>
            DataInicio
        </th>
        <th>
            DataFim
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Editar", "Manter", new { id=item.Id }) |
            @Html.ActionLink("Detalhes", "DetalhesLeitura", new { id=item.Id }) |
            @Html.ActionLink("Deletar", "Deletar", new { id=item.Id })
        </td>
        <td>
            @item.Titulo
        </td>
        <td>
            @item.Autor.Nome
        </td>
        <td>
            @String.Format("{0:g}", item.DataInicio)
        </td>
        <td>
            @String.Format("{0:g}", item.DataFim)
        </td>
    </tr>
}

</table>

